package com.heiye.relation.biz.domain.mapper;

import com.heiye.relation.biz.domain.dataobject.QuizFollowingDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface QuizFollowingDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(QuizFollowingDO record);

    int insertSelective(QuizFollowingDO record);

    QuizFollowingDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(QuizFollowingDO record);

    int updateByPrimaryKey(QuizFollowingDO record);

    /**
     * 查找用户关注的问题列表
     *
     * @param userId
     * @return
     */
    List<QuizFollowingDO> selectByUserId(Long userId);

    /**
     * 根据用户id和关注的问题id删除记录
     *
     * @param userId
     * @param unfollowQuizId
     * @return
     */
    int deleteByUserIdAndFollowingQuizId(@Param("userId") Long userId,
                                         @Param("unfollowQuizId") Long unfollowQuizId);

    /**
     * 根据用户id和关注的问题id查询记录
     *
     * @param userId
     * @param followingQuizId
     * @return
     */
    int selectByUserIdAndFollowingQuizId(@Param("userId") Long userId,
                                         @Param("followingQuizId") Long followingQuizId);
}